Skip to content

[WIP] feat(automations): port Stream Avatar automations natively into Desktop - #6020

Open
AnkhHeart wants to merge 80 commits into
masterfrom
ankh/automations
Open

[WIP] feat(automations): port Stream Avatar automations natively into Desktop#6020
AnkhHeart wants to merge 80 commits into
masterfrom
ankh/automations

Conversation

@AnkhHeart

@AnkhHeart AnkhHeart commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports the Automations feature (previously agent-driven, socket-based) into
Desktop as a native, event-driven engine, and adds the full authoring UI:
pre-made templates, a create/edit flow, and a condition/action editor.

Automations let a streamer say "when X happens in-game, do Y in Streamlabs" —
e.g. switch scene on elimination, flash a source on a team score, or have the
AI co-host bark a line — without needing the desktop companion agent process
running.

What changed

Engine (app/services/stream-avatar/)

  • AutomationsEngineService — subscribes to VisionService game events over
    the existing websocket, maintains a GameState/prevState diff per tick, and
    fires matching automations' actions. Runs only in the worker window
    (Utils.isWorkerWindow()) to avoid double-firing across processes.
  • engine/conditions.ts — condition registry across 24 supported games
    (Fortnite, Valorant, CS2, Apex, League, Dota 2, Rocket League, etc.) plus a
    STREAMLABS-scoped set, each with typed props and an evaluate() function.
  • engine/actions.ts — action registry: switch_to_scene, show_source /
    hide_source (with "revert when condition clears" toggles), save_replay,
    wait_for_ms, and two co-host actions (comment, instruction) that talk
    to the AI agent.
  • engine/instructions.ts — per-condition instruction templates that get
    interpolated with live game state and sent to the co-host.
  • engine/properties.ts / validation.ts / game-state.ts — shared
    property types for the editor UI and condition/action validation.
  • AutomationsService — Vuex-backed CRUD store (fetchAll/create/
    update/remove) with exponential-backoff retry on fetch failure, synced
    from the API on login and cleared on logout.
  • StreamAvatarApiService — new REST client for stream-avatar-api
    (JWT mint/cache/refresh-on-401, automations CRUD, templates, simulation,
    and fire-and-forget agent instruction/trigger endpoints). Replaces the old
    AgentSocketService socket transport for this feature.

UI (app/components-react/pages/stream-avatar-automations/)

  • PreMadeAutomations — browsable template gallery (per-game, with
    video/image previews) for one-click automation creation.
  • AutomationEditor — condition/action builder (Ant Design-based) with
    drag-and-drop action reordering, scene/source pickers, and a "simulate"
    action that runs an automation's actions on demand for preview.
  • EditAutomations — the automations list window (enable/disable, edit,
    delete, create).
  • AutomationsElement — scene-editor-panel entry point into the feature.
  • useAgentAppInstalled hook — detects whether the Intelligent Streaming
    Agent platform app is installed/enabled (reactive off PlatformAppsService)
    and prompts install/enable where an automation depends on the co-host.
  • Analytics (AutomationsAnalytics.ts) and i18n strings
    (stream-avatar-automations.json) for the new flows.

Supporting changes

  • SourcesModule (platform-apps API): add filter-visibility get/set so
    actions can toggle source filters, not just source visibility.
  • Scrollable: ResizeObserver-driven layout updates for the new scrollable
    panels.
  • app-services.ts: registers StreamAvatarApiService, AutomationsService,
    AutomationsEngineService.

Why

Moves Automations off the agent-socket dependency and into a first-class
Desktop feature, so condition/action evaluation runs locally in the worker
process against the existing Vision websocket feed instead of round-tripping
through a separate agent connection. This removes a runtime dependency and
lets the feature ship in Desktop's own release cadence.

Testing

  • Create, edit, enable/disable, and delete an automation from the list UI
  • Verify a pre-made template creates a working automation with correct
    sources/actions pre-filled
  • Trigger a game condition (or use "simulate") and confirm the mapped
    action fires (scene switch, source show/hide, replay save, co-host bark)
  • Confirm show/hide-source actions revert correctly when the condition
    clears
  • Log out/in and confirm automations reload and the retry backoff doesn't
    spin when logged out
  • Confirm the Intelligent Streaming Agent install/enable prompt appears
    only for automations that need the co-host, on Windows

AnkhHeart added 30 commits June 3, 2026 17:04
…d integrate AgentSocketService for simulation messaging
…n and installation prompts in automation editor
…onents, add PreMadeAutomationsFooter for improved UI and functionality
@AnkhHeart AnkhHeart changed the title feat(automations): port Stream Avatar automations natively into Desktop [WIP] feat(automations): port Stream Avatar automations natively into Desktop Jul 14, 2026
@bundlemon

bundlemon Bot commented Jul 14, 2026

Copy link
Copy Markdown

BundleMon

Files updated (1)
Status Path Size Limits
renderer.(hash).js
8MB (+151.71KB +1.89%) -
Unchanged files (3)
Status Path Size Limits
vendors~renderer.(hash).js
4.67MB -
updater.js
115.29KB -
guest-api.js
40.23KB -

Total files change +151.71KB +1.17%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

…nce EditAutomations with welcome screen and improved layout
…r, EditAutomations, and PreMadeAutomations for cleaner code
- Simplified imports in AutomationEditor by removing unused components and functions.
- Removed unnecessary constants and functions related to action options and game options.
- Extracted ActionEditor component logic into a separate file for better organization.
- Updated condition options retrieval to streamline the process.
- Improved the handling of agent app requirements in ActionEditor.
- Cleaned up styles in PreMadeAutomations and removed unused CSS classes.
- Created TemplatePreview component for handling media previews.
- Moved asset downloading and template source creation logic to a new utility file.
- Consolidated utility functions for badge colors, video URL checks, and action summarization.
- Updated EditAutomations to utilize new GAME_OPTIONS from automations-utils.
- Adjusted AutomationsAnalytics to remove unused action types.
Comment thread app/components-react/hooks/useAgentAppInstalled.ts
];
return (
<>
<Select

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could move the returned components to their own functional component at the bottom, or a new component file with variants, for readability and to remove the need for a fragment.

];
return (
<>
<Select

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for functional component


case 'common.wait_for_ms':
return (
<>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for functional component

);

case 'co-host.instruction':
if (!agentReady) return renderAgentRequiredNotice();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for functional component

case 'co-host.instruction':
if (!agentReady) return renderAgentRequiredNotice();
return (
<>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for functional component

case 'co-host.comment':
if (!agentReady) return renderAgentRequiredNotice();
return (
<p

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for functional component

);

default:
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worthwhile to return a string or component with a user-facing error message?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, now it'll just show blank when nothing is selected which is fine for the initial state they get when trying to create an automation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sg

…ter components, implement template selection logic and analytics tracking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants